import React from 'react';
import SiderMenu from '@/components/SiderMenu/SiderMenu';
import { getFlatMenuKeys } from './SiderMenuUtils';

/**
 * memo针对 一个组件的渲染是否重复执行
 * @type {React.NamedExoticComponent<object>}
 */
const SiderMenuView = React.memo(props => {
  const { menuData } = props;

  const flatMenuKeys = getFlatMenuKeys(menuData);

  return <SiderMenu {...props} flatMenuKeys={flatMenuKeys} />
});
export default SiderMenuView;
